create view cate_view2 as 
select id as category_cd ,category_name,parent as parent_category_cd ,if(parent = 3 ,0 , 1) as category_level from m_category 
where parent = 3 or parent in (select id from m_category where parent = 3)
HUASI
<?php
?>